#include "app_buffer.h"

int main(int argc, char const *argv[])
{

    buffer_t *buffer = app_buffer_init(20);
    app_buffer_write(buffer, "hello1", 6);
    app_buffer_write(buffer, "hello2", 6);
    uint8_t data[128];
    uint8_t real_len = app_buffer_read(buffer, data, sizeof(data));
    log_info("%.*s", real_len, data);
    app_buffer_write(buffer, "hello3", 6);
    app_buffer_write(buffer, "hello4", 6);

    real_len = app_buffer_read(buffer, data, sizeof(data));
    log_info("%.*s", real_len, data);
    real_len = app_buffer_read(buffer, data, sizeof(data));
    log_info("%.*s", real_len, data);

     real_len = app_buffer_read(buffer, data, sizeof(data));
    log_info("%.*s", real_len, data);

    return 0;
}
